public class Main {
    public static void main(String[] args) {
        // 创建绿头鸭对象
        MallardDuck mallard = new MallardDuck("绿色", 1.2);
        System.out.println("绿头鸭颜色: " + mallard.color);
        System.out.println("绿头鸭重量: " + mallard.heavy + "kg");
        mallard.fly();
        mallard.quack();
        mallard.setHeavy(1.5); // 使用重载的setHeavy方法
        System.out.println("更新后绿头鸭重量: " + mallard.heavy + "kg\n");

        // 创建橡皮鸭对象
        RubberDuck rubberDuck = new RubberDuck("黄色", 0.3);
        System.out.println("橡皮鸭颜色: " + rubberDuck.color);
        System.out.println("橡皮鸭重量: " + rubberDuck.heavy + "kg");
        rubberDuck.fly();
        rubberDuck.quack();
        rubberDuck.setHeavy("0.5kg"); // 使用重载的setHeavy方法
        System.out.println("更新后橡皮鸭重量: " + rubberDuck.heavy + "kg");
    }
}
